//#ifdef __STU_WIN32__
#ifndef __STU_VERTEXBUFFER__
#define __STU_VERTEXBUFFER__

#include <d3d9.h>

#include "Defines.h"

namespace MegaEngine
{
	template <class VertexType, unsigned int FVF>
	class VertexBuffer
	{
		unsigned int bufferSize;
		unsigned int flushMax;
		unsigned int lockFrom;
		//unsigned int AmountToLock;//hmmmmm
		//D3DPRIMITIVETYPE PrimitiveType;//hmmmm
		IDirect3DDevice9* graphCardHandle;
		//VertexType * Vertexs;// no figura
		LPDIRECT3DVERTEXBUFFER9 DXVertexObject;

	public:
		VertexBuffer(IDirect3DDevice9 * graphCardHandle, bool isDynamic);
		~VertexBuffer();

		//bool Create();
		void Release();
		bool Draw(VertexType * vertexCollection, 
					D3DPRIMITIVETYPE primitiveType, unsigned int vertexCount);
		void Bind();
		bool Flush(D3DPRIMITIVETYPE primitiveType, unsigned int amountToLock);
	};
}

#include "VertexBuffer.inl"

#endif //__STU_VERTEXBUFFER__
//#endif